package clone;

public class Student2 implements Cloneable {
	private String name;
	private int age;
	private Teacher2 teacher;
	
	public Student2(String name, int age, Teacher2 teacher){
		this.name = name;
		this.age = age;
		this.teacher = teacher;
	}
	
	
	public String getName() {
		return name;
	}


	public void setName(String name) {
		this.name = name;
	}


	public int getAge() {
		return age;
	}


	public void setAge(int age) {
		this.age = age;
	}


	public Teacher2 getTeacher() {
		return teacher;
	}


	public void setTeacher(Teacher2 teacher) {
		this.teacher = teacher;
	}


	@Override
	protected Object clone() {
	
		Object obj = null;
		try {
			obj = super.clone();
		} catch (CloneNotSupportedException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return obj;
	}


	@Override
	public String toString() {
		return "Student2 [name=" + name + ", age=" + age + ", teacher=" + teacher + "]";
	}


	
}
